package com.zy.cat.entity.dev;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.Index;
import javax.persistence.Table;

import com.zy.cat.entity.primary.CatDevUserInfoPrimary;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.RequiredArgsConstructor;

/**
 * 
 * @info 9趣猫用户详细信息实体类
 * @author Link
 * @date 2019-10-30 08:56
 */
@Entity
@Table(name = "zy_cat_user",
indexes = {
		@Index(name = "pid", columnList = "pid"), 
		@Index(name = "unionid", columnList = "unionid"), 
		@Index(name = "sex", columnList = "sex"), 
		@Index(name = "tbid", columnList = "tbid"), 
		@Index(name = "tbrid", columnList = "tbrid"),
		@Index(name = "istatus", columnList = "istatus"),
		@Index(name = "ctime", columnList = "ctime") })
@Data
@RequiredArgsConstructor
@IdClass(CatDevUserInfoPrimary.class)
@ApiModel("9趣猫用户详细信息实体类")
public class CatDevUserInfo {
	
	@Id
	@Column(columnDefinition = "VARCHAR(100) NOT NULL COMMENT '微信号unionid'")
	@ApiModelProperty(value = "微信号unionid", example = "oQl1f0kaeX9R9GjujjrvsCtfWa4Y")
    private String unionid="";
	
	@Column(columnDefinition = "VARCHAR(100) NOT NULL COMMENT '微信号openid'")
	@ApiModelProperty(value = "微信号openid", example = "oQl1f0kaeX9R9GjujjrvsCtfWa4Y")
    private String openid="";
	
	@Id
	@Column(columnDefinition = "VARCHAR(20) NOT NULL COMMENT '9趣猫用户ID'")
	@ApiModelProperty(value = "9趣猫用户ID", example = "18986866666")
    private String pid="";
	
	@Column(columnDefinition = "VARCHAR(50) DEFAULT '' COMMENT '苹果账户ID'")
	@ApiModelProperty(value = "苹果账户ID", example = "18986866666")
    private String userid="";
	
	@Column(columnDefinition = "VARCHAR(100) NOT NULL COMMENT '用户昵称'")
	@ApiModelProperty(value = "用户昵称", example = "Link")
    private String nikename="";
	
	@Column(columnDefinition = "INT(1) NOT NULL COMMENT '用户0.女、1.男'")
	@ApiModelProperty(value = "用户0.女、1.男", example = "0")
    private int sex;
	
	@Column(columnDefinition = "VARCHAR(500) NOT NULL COMMENT '用户微信头像'")
	@ApiModelProperty(value = "用户微信头像", example = "https://")
    private String icon="";
	
	@Column(columnDefinition = "CHAR(11) DEFAULT '' COMMENT '手机号'")
	@ApiModelProperty(value = "手机号", example = "13854807520")
    private String phone="";
	
	@Column(columnDefinition = "VARCHAR(50) DEFAULT '' COMMENT '淘宝授权会员名'")
	@ApiModelProperty(value = "淘宝授权会员名", example = "tb_1006846")
    private String tbname="";
	
	@Column(columnDefinition = "VARCHAR(50) DEFAULT '' COMMENT '淘宝ID'")
	@ApiModelProperty(value = "淘宝ID", example = "584646863")
    private String tbid="";
	
	@Column(columnDefinition = "VARCHAR(50) DEFAULT '' COMMENT '淘宝授权渠道ID'")
	@ApiModelProperty(value = "淘宝授权渠道ID", example = "584646863")
    private String tbrid="";
	
	@Column(columnDefinition = "VARCHAR(32) DEFAULT '-' COMMENT '支付宝提款账户'")
	@ApiModelProperty(value = "支付宝提款账户", example = "13854197520")
	private String zaccount;
	
	@Column(columnDefinition = "VARCHAR(32) DEFAULT '-' COMMENT '支付宝提款账户真是姓名'")
	@ApiModelProperty(value = "支付宝提款账户真是姓名", example = "张三")
	private String zrealname;
	
	@Column(columnDefinition = "VARCHAR(200) DEFAULT '-'  COMMENT '身份证前照片'")
	@ApiModelProperty(value = "身份证前照片", example = "https://")
    private String fidcard1="";
	
	@Column(columnDefinition = "VARCHAR(200) DEFAULT '-' COMMENT '身份证后照片'")
	@ApiModelProperty(value = "身份证后照片", example = "https://")
    private String fidcard2="";
	
	@Column(columnDefinition = "INT(2) DEFAULT '0' COMMENT '财务信息状态，-1.审核失败、0.待补充、1.审核中、2.审核通过'")
	@ApiModelProperty(value = "财务信息状态，-1.审核失败、0.待补充、1.审核中、2.审核通过", example = "0")
	private int fstatus;
	
	@Column(columnDefinition = "VARCHAR(20) DEFAULT '-' COMMENT '用户真实姓名'")
	@ApiModelProperty(value = "用户真实姓名", example = "")
    private String realname="";
	
	@Column(columnDefinition = "VARCHAR(20) DEFAULT '-' COMMENT '身份证号'")
	@ApiModelProperty(value = "身份证号", example = "395000005515502")
	private String idcard;
 
	@Column(columnDefinition = "INT(2) DEFAULT '0' COMMENT '用户状态，-1.账号冻结、0.审核中、1.审核通过、2.账户已注销'")
	@ApiModelProperty(value = "用户状态，-1.账号冻结、0.审核中、1.审核通过、2、账户已注销", example = "0")
	private int istatus;
	
	@Column(columnDefinition = "INT(2) DEFAULT '0' COMMENT '用户类型（0.新用户、1.老用户）'")
	@ApiModelProperty(value = "用户类型（0.新用户、1.老用户）", example = "1")
	private int utype;
 
	@Column(columnDefinition = "VARCHAR(20) DEFAULT '-'  COMMENT '创建时间'")
	@ApiModelProperty(value = "创建时间", example = "2019-02-22 12:56:56")
	private String ctime="-";
	
	@Column(columnDefinition = "VARCHAR(20) DEFAULT '-'  COMMENT '最后修改时间'")
	@ApiModelProperty(value = "最后修改时间", example = "2019-02-22 12:56:56")
	private String ltime="-";
	
	@Column(columnDefinition = "VARCHAR(20) DEFAULT '2020-01-01' COMMENT '淘礼金查看时间'")
	@ApiModelProperty(value = "备注", example = "淘礼金查看时间")
    private String tljtime="-";
	
	@Column(columnDefinition = "VARCHAR(100) DEFAULT '-' COMMENT '备注'")
	@ApiModelProperty(value = "备注", example = "备注")
    private String info="-";
	
	
	
	
	/* 信息查询专用 */
	public CatDevUserInfo(String unionid, String pid) {
		super();
		this.unionid = unionid;
		this.pid = pid;
	}
	
	/* 更新微信信息专用 */
	public CatDevUserInfo(String unionid,String openid, String nikename, String icon) {
		super();
		this.unionid = unionid;
		this.openid = openid;
		this.nikename = nikename;
		this.icon = icon;
	}
	

	/* 注册专用 */
	public CatDevUserInfo(String pid,String unionid,String openid, String nikename, String icon,int sex,int utype) {
		super();
		this.pid = pid;
		this.unionid = unionid;
		this.openid = openid;
		this.nikename = nikename;
		this.icon = icon;
		this.sex = sex;
		this.utype=utype;
	}

	public CatDevUserInfo(String pid) {
		super();
		this.pid = pid;
	}

	public CatDevUserInfo(String unionid,String pid, String info) {
		super();
		this.unionid = unionid;
		this.pid = pid;
		this.info = info;
	}
	

//	/* 修改淘宝授权专用 */
//	public CatDevUserInfo(String unionid, String pid, String tbname,String tbid,String info) {
//		super();
//		this.unionid = unionid;
//		this.pid = pid;
//		this.tbname = tbname;
//		this.tbid = tbid;
//		this.info = info;
//	}
	
	
}
